<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>罗米后台管理-后台管理</title>
		<link rel="stylesheet" href="/Public/css/pintuer.css">
		<link rel="stylesheet" href="/Public/css/admin.css">
		<script src="/Public/js/jquery.js"></script>
		<script src="/Public/js/pintuer.js"></script>
		<script src="/Public/js/respond.js"></script>
		<script src="/Public/js/admin.js"></script>
		<link type="image/x-icon" href="/favicon.ico" rel="shortcut icon" />
		<link href="/favicon.ico" rel="bookmark icon" />
		<base target="iframe" />
	</head>

<body>

	<script src="/Public/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
	<link rel="stylesheet" type="text/css" href="/Public/uploadify/uploadify.css" />

	<!--载入hdjs-->
	<link rel="stylesheet" type="text/css" href="/Public/hd/hdjs/hdjs.css" />
	<script type="text/javascript" src="/Public/hd/hdjs/hdjs.min.js"></script>

	<script>
		var type = "<?php echo ($set["type"]); ?>";
		var name = "<?php echo ($set["name"]); ?>";
		var APP = "/index.php";
		var PUBLIC = "/Public";
		var host = "<?php echo ($host); ?>";
	</script>
	<style type="text/css">
		.Minus1{
			position: absolute;
			top: 2px;
			right: 2px;
		}
	</style>
	<div class="hd-tab">
		<ul class="hd-tab-menu">
			<li lab="uploadFile" class="active">
				<a>上传文件</a>
			</li>
			<li lab="webFile">
				<a>站内文件</a>
			</li>
			<li lab="noUse">
				<a>未使用文件</a>
			</li>
		</ul>
		<div class="hd-tab-content">
			<div lab="uploadFile" class="hd-tab-area">
				<input id="file" type="file" multiple="true">
				<span class="hd-validate-notice">类型: <?php echo ($set["filetype"]); ?> 大小: <?php echo ($set["allow_size"]); ?>KB 数量: <?php echo ($set["num"]); ?></span>
				<script type="text/javascript">
					$(function() {
						var timestamp = "<?php echo time(); ?>";
						var token = "<?php echo md5('unique_salt'.time()) ?>";
						$('#file').uploadify({
							'formData': {
								'timestamp': timestamp,
								'token': token
							},
							'swf': PUBLIC + '/uploadify/uploadify.swf',
							'uploader': APP + '/Lmkj/Content/upload',
							'fileTypeDesc': '上传文件', //上传描述
							'fileTypeExts': "<?php echo ($set['filetype']); ?>",
							'buttonText': '选择文件',
							'fileSizeLimit': '<?php echo ($set["allow_size"]); ?>KB',
							'uploadLimit': 1000, //上传文件数
							'width': 65,
							'height': 25,
							'successTimeout': 10, //等待服务器响应时间
							'removeTimeout': 0.2, //成功显示时间
							'onUploadSuccess': function(file, data, response) {
								data = $.parseJSON(data) ;
								var imgageUrl = '/Uploads/'+data.savepath+data.savename;
								var li = $("<li style='position: relative;' path='"+data.savepath+"' url='"+imgageUrl+"' />");
								var img = $("<img/>",{
									src : imgageUrl,
									width : "80px",
									height:'80px'
								}).addClass("radius-small").appendTo(li);
								var a = $("<a/>",{
									href : 'javascript:;',
									onClick : 'del(this);return false;',
									name : file.name,
									type : file.type,
									filesize : file.size
								}).addClass('Minus1').html("X").appendTo(li);
								
								$("#uploadList ul").prepend(li);
							}
						})
					})
				</script>
				<div id="uploadList" class="imagelist">
					<ul>
						
					</ul>
				</div>
			</div>
			<div lab="webFile" id="webFile" class="imagelist  hd-tab-area">

			</div>
			<div lab="noUse" id="noUse" class="imagelist  hd-tab-area">

			</div>
		</div>
	</div>
	<link rel="stylesheet" type="text/css" href="/Public/hd/uploadFile.css" />
	<script type="text/javascript" src="/Public/hd/uploadFile.js"></script>
</body>

</html>